/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.teacake.filteringproxy;

/**
 *
 * @author tkleisas
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        try
        {
            String ip = "127.0.0.1";
            int port = 8080;
            String logfile = "./";
            for(int i=0;i<args.length;i++)
            {
                if(args[i].equalsIgnoreCase("-a"))
                {
                    if(i+1<args.length)
                    {
                        ip = args[i+1];
                    }
                }
                if(args[i].equalsIgnoreCase("-p"))
                {
                    if(i+1<args.length)
                    {
                        port = Integer.parseInt(args[i+1]);
                    }

                }
                if(args[i].equalsIgnoreCase("-l"))
                {
                    if(i+1<args.length)
                    {
                        logfile = args[i+1];
                    }
                }
            }
            HttpProxyServer server = new HttpProxyServer(ip,port,logfile);
            server.start();
        // TODO code application logic here
        }
        catch(Exception e)
        {
            
        }

    }

}
